import Vue from 'vue';
import Router from 'vue-router';
import system from './router/system';
Vue.use(Router);
const routes = [
    {
        path: '/login',
        component: () => import('@/common/Login.vue'),
        meta: { title: '登录' }
    },
    {
        path: '/',
        component: () => import('@/common/Home.vue'),
        meta: { title: '首页'},
        children: [...system],
        redirect:'/match'
    }
];

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err)
}
const router = new Router({ mode: 'hash', routes,base: (process.env.NODE_ENV === 'development'?'':'/weChatApp')});
export default router;
